#include <iostream>
#include <algorithm>

int main() {
    // 一维数组示例
    int numbers[] = {5, 2, 8, 1, 9};
    int size = sizeof(numbers) / sizeof(numbers[0]);

    std::cout << "Original array: ";
    for (int i = 0; i < size; i++) {
        std::cout << numbers[i] << " ";
    }

    // 排序
    std::sort(numbers, numbers + size);
    
    std::cout << "\nAfter sorting: ";
    for (int i = 0; i < size; i++) {
        std::cout << numbers[i] << " ";
    }

    // 二维数组示例
    int matrix[3][3] = {
        {1, 2, 3},
        {4, 5, 6},
        {7, 8, 9}
    };

    std::cout << "\n\n2D array: " << std::endl;
    for (int i = 0; i < 3; i++) {
        for (int j = 0; j < 3; j++) {
            std::cout << matrix[i][j] << " ";
        }
        std::cout << std::endl;
    }

    return 0;
}